#ifndef CONTACTNAME_H
#define CONTACTNAME_H



#include <QWidget>
#include <QTimer>
#include <QtGui/QMainWindow>
#include <qfeedbackactuator.h>
#include <qfeedbackeffect.h>

#define ItemPressed "border-radius: 20px;"\
"background-color: qlineargradient(spread:pad, x1:0.505, y1:0.170136, x2:0.495, y2:0.948864, stop:0 rgba(122, 50, 255, 241), stop:0.880682 rgba(0, 20, 106, 255));"

#define ItemReleased "border-radius: 10px;"\
"background-color: qlineargradient(spread:pad, x1:0.505, y1:0.170136, x2:0.495, y2:0.948864, stop:0 rgba(0, 20, 106, 255), stop:0.880682 rgba(122, 50, 255, 241));"
#define ItemAbsent "background-color: qlineargradient(spread:pad, x1:0.516864, y1:0, x2:0.5, y2:1, stop:0 rgba(155, 155, 155, 221), stop:1 rgba(203, 203, 203, 255));"\
"color: rgb(54, 54, 54);"


QTM_USE_NAMESPACE



namespace Ui {
    class contactName;
}

class contactName : public QWidget
{
    Q_OBJECT

public:
    explicit contactName(QWidget *parent = 0);
    ~contactName();
    void setImage(QPixmap aPixmap);
    void setName(QString aText);
    void setInfo (QString aText);
    void setIndex(int aIndex);
    void setUid(QByteArray aUID);
    void setAbsent();
    bool event(QEvent *);
    void setPresent();
    QString getName();
    QByteArray getUID();

private:
    Ui::contactName *ui;

    bool mMousePressed;
    bool mMouseMoved;
    QPoint mStart;
    int mIdex;
    QByteArray muID;
    bool mPresent;
    bool mAbsent;


    bool m_is_mouse_pressed;
    QTimer m_mousepressed_timer;

signals:
    void longPress(int index);
    void shortPress(int index);
    void studentClicked(QByteArray aUID,QString aStudentName);

private slots:
    void mousePressedTimeout();

};

#endif // CONTACTNAME_H
